import { createStore } from "vuex";
<<<<<<< HEAD

export default createStore({
  state: {},
  mutations: {},
=======
// 全局变量[专门接收本地存储的数据]
let defaultCity='广州'
// 在localStorage对象中初始化一个属性city的值
if(localStorage.city){
	//有值的
	defaultCity=localStorage.city
}

export default createStore({
  state: {
	  cityName:defaultCity,
  },
  mutations: {
	  changeCity(state,val){
		  //传新的城市过来的时候，直接将其存入本地
		  state.cityName=val
		  localStorage.city=val
	  }
  },
>>>>>>> d0d9ac1 (首页)
  actions: {},
  modules: {},
});
